package com.lcz.authority.common.exception.constants;


import com.lcz.authority.common.exception.base.BaseException;

/**
 * System 错误码枚举类
 * system 系统，使用 1-002-000-000 段
 *
 * @author leixiujie
 */
public interface ErrorCodeConstants {

    BaseException SUCCESS = new BaseException(200, "成功");

    // ========== 客户端错误段 ==========

    BaseException BAD_REQUEST = new BaseException(400, "请求参数不正确");
    BaseException UNAUTHORIZED = new BaseException(401, "账号未登录");
    BaseException FORBIDDEN = new BaseException(403, "没有该操作权限");
    BaseException NOT_FOUND = new BaseException(404, "请求未找到");
    //not.null=* 必须填写
    BaseException METHOD_NOT_ALLOWED = new BaseException(405, "请求方法不正确");
    BaseException LOCKED = new BaseException(423, "请求失败，请稍后重试"); // 并发请求，不允许
    BaseException TOO_MANY_REQUESTS = new BaseException(429, "请求过于频繁，请稍后重试");
    BaseException PASSWORD_CONTAINS_SPACE = new BaseException(430, "密码不能包含空格");
    BaseException USER_NAME_TOO_LONG = new BaseException(431, "用户名最长30位");
    BaseException ROLE_ID_NOT_NULL = new BaseException(432, "角色id不能为空");
    BaseException NAME_REPEAT = new BaseException(433, "名称重复");


    BaseException CAPTCHA_ERROR = new BaseException(434, "验证码错误");
    BaseException CAPTCHA_EXPIRE = new BaseException(435, "验证码已失效");
    BaseException USER_PASSWORD_ERROR = new BaseException(436, "用户不存在/密码错误");
    BaseException USER_PASSWORD_RETRY_LIMIT_EXCEED = new BaseException(437, "密码输入错误{0}次，帐户锁定{1}分钟");
    //upload.exceed.maxSize=上传的文件大小超出限制的文件大小！<br/>允许的文件最大大小是：{0}MB！
    BaseException FILE_SIZE_LIMIT_EXCEED = new BaseException(438, "上传的文件大小超出限制的文件大小！<br/>允许的文件最大大小是：{0}MB！");
    //upload.filename.exceed.length=上传的文件名最长{0}个字符
    BaseException FILE_NAME_LENGTH_LIMIT_EXCEED = new BaseException(439, "上传的文件名最长{0}个字符");

    // ========== 服务端错误段 ==========
    BaseException INTERNAL_SERVER_ERROR = new BaseException(500, "系统异常");
    BaseException USER_NAME_EXIST = new BaseException(503, "用户名已存在");
    BaseException TEL_EXIST = new BaseException(504, "手机号已存在");
    BaseException EMAIL_EXIST = new BaseException(505, "邮箱已存在");
    BaseException USER_NAME_EMPTY = new BaseException(506, "用户名不能为空");
    BaseException PASSWORD_EMPTY = new BaseException(507, "密码不能为空");
    BaseException ORGANIZATION_NOT_EXIST = new BaseException(508, "机构不存在");
    BaseException ORGANIZATION_EMPTY = new BaseException(509, "机构不能为空");
    BaseException DELETE_FAIL = new BaseException(510, "删除失败");

    BaseException NOT_IMPLEMENTED = new BaseException(501, "功能未实现/未开启");
    BaseException ERROR_CONFIGURATION = new BaseException(502, "错误的配置项");
    BaseException SQL_INIT_ERROR = new BaseException(511, "sql文件初始化异常");

    // ========== 自定义错误段 ==========
    BaseException REPEATED_REQUESTS = new BaseException(900, "重复请求，请稍后重试"); // 重复请求
    BaseException DEMO_DENY = new BaseException(901, "演示模式，禁止写操作");
    BaseException UNKNOWN = new BaseException(999, "未知错误");


}
